package cn.edu.scau.cmi.wuzhenxin.client;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class SafeComponentClient extends Application{
//	public static void main(String args[]) {
//		ConsistentComposite composite1= new ConsistentComposite("目录1");
//		ConsistentComponent leaf1 = new SafeLeaf("文档1.1");
//		ConsistentComponent leaf2 = new SafeLeaf("文档1.2");
//		composite1.add(leaf1);
//		composite1.add(leaf2);
//		ConsistentComposite composite2 = new ConsistentComposite("目录1-1");
//		ConsistentComponent leaf3 = new SafeLeaf("文档1-1.1");
//		composite2.add(leaf3);
//		composite1.add(composite2);
//		System.out.println(leaf3.getParent().getParent().say());
//	}
	public static void main(String[] args) {
		launch(args);
	}
	
	public void start(Stage stage) {
		try {
            Parent root = FXMLLoader.load(getClass().getResource("SafeComponent.fxml"));
            Scene scene = new Scene(root,560,575);
            stage.setScene(scene);
            stage.setResizable(false);
            stage.setTitle("实验四：安全组合模式");
            stage.show();
        } catch(Exception e) {
            e.printStackTrace();
        }
	}
	public void openNewView() {//用于综合性实验开启界面
		Stage stage = new Stage();
		try {
			Parent root = FXMLLoader.load(getClass().getResource("SafeComponent.fxml"));
			stage.setScene(new Scene(root));
			stage.setTitle("实验5：安全组合模式");
			stage.show();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}
